Adding some asserts in models.js