Fix errorcodes compilation + minor edits