Fix status code type, check entity id.