   }
 
   // Ensure water heater is on if temperature is at or below heater threshold.
-  if (TempF <= heaterThreshold) {
+  if (tempF <= heaterThreshold) {
     if (!heaterState) {
       if (Debugging) {
         debugger.println("Turning on water heater.");

int           doorTopVal      = 0;
int           doorTopVal2     = 0;
int           doorTopState    = 0;
int           doorBottomVal   = 0;
int           doorBottomVal2  = 0;
int           doorBottomState = 0;

RTC_DS1307 rtc;
OneWire ds(tempSense);

  // ---------------------------

  // Ensure fan is on if temperature is at or above fan threshold.
  if (tempF >= fanThreshold) {
    if (!fanState) {
      if (Debugging) {
        debugger.println("Turning on fan.");
