Fixed a couple of issues with error event codes