Fixed hard fault error with interrupt context switching