Fix a bug in Model.java