Fixed some interrupt/wake timing bugs