Set correct error code field.