ORM updates and code fixes
These should have been removed long ago