Fixed a few timing bugs