bug fixes to buildmodel1