#308 Further hardening of the hardware event handling code