Fixed bug with not checking Model.Count