Fixed compile errors in TapMachine event handler