Fixed time range rule crashes.

Also, the time range rule now activates on the exact minute it should, rather than being off by a few seconds.