Fixed bug in timer and IRQs