[FIX] Error codes: more error code fixes
Merge pull request #1581 from annatonger/fix/errorcodes2

[FIX] Error codes: more error code fixes