Small fixes to model.js