Fix notices, warnings.
Fix bugs introduced by refactoring on JS view models.