Fix broken ORM compatibility