Fix bug with Doctrine Proxy class