Clean up in model.js.
Merge head with last commit.