Drop the exception throwed if there are table relations. Fixed the count method in model