Fix ORM relations