Fixed a bug that would avoid users being able to create models that reference themselves.
Fixed little bugs in Model.