Fixed errors in model.py