DDC-2775 Tests and fix

http://www.doctrine-project.org/jira/browse/DDC-2775