Revert "Fix error codes"

This reverts commit 2b7e01fd6a5ef02c7ffe750208c1aca27d4dbf2c.
Fix error codes