Fix small bugs in models.py.