Fix to call end on interrupt.