Bug fix on ORM