Fixed bug in defineModel().