Fixed some bugs with the models and migrations