fix errors in models and migrations