Fixed a number of issues with timing and run-a-way loops.