Fixes a big bug with model.js.
Fixes #429.