Fix timer interrupt to prevent crash on reset.