Fixed a few bugs that were preventing the clock from working correctly.