Fix timer IRQs and up-counting problem