Fix bug with doctrine entity fetching