Add support for new command types and error codes
Merge branch 'new-error-codes-v2'