Fixed bug in model#delete