Fixes Midnight Rollover Protection

* Fixed the non-existent Midnight Rollover Protection.
* Moved Midnight Rollover Protection to "timeleft()".
* Removed "direction == 2" check, because "direction" is never 2.