Fixed a few bugs that prevented proper idle times from being computed.