Fix bug in ModelUtils.