ORM bug fix