Fixed timing bugs