Fix timer and mode switch