Bug fixes in Model->delete()