I use DS1307 a lot and it must be super reliable for years, otherwise concentrator sunlight could start fires or melt rocks. I have not read your code but have experience strange RTC behavior and have found solutions. Dirty power on/off/on can corrupt time. That was solved with BAT85 diode and 0.1 uF cap. See schematic (lower left) at http://www.harbornet.com/sunflower/PCB.jpg.

The clock is read about 10 times per second. And the time is reset once per day at solar noon when azimuth is due south. Only once in four years the clock indicated an accidental reset or read error. Then the code was updated for error trapping to set flags for ground protection. Now the clock is read twice per main loop and if the time is different it is read twice again. Also if the time does not change in little more than one second then RTC fail is flagged. The RTC has since been 100% for 6 years -- zero fails and zero flags.

Search for "Get_Time:" in this code http://www.harbornet.com/sunflower/PCB.pbp

--Doug