Fix error code mismatches