Fixed issue where deleting a model instance with a to-one association where the associated key is undefined caused an error.