Fix same minor problems with timekeeping logic

Now even weird steprates like 7 works correctly.
Precise syncing with long intervals still does not work well.

Conflicts:
	clock.py