model.py: always check for migration and minor bug fixes