ORM\EntityRepository fixes, and start writting tests for it