Fixed a few timing bugs for the tests