Fixes from defining models in code