Fixed timing bugs.