Events: code organization/cleanup, set "error" exit code to 1 instead of 2 (+ test it!)