Fixed exception when deleting a schema.