models.py: bug fixes