fix some bugs in models
Merge pull request #3009 from ZappoMan/bugFix

fix some bugs in models