Fixed DDC-1884.

Fixed original failing test case provided in https://github.com/doctrine/doctrine2/pull/395 and highlighted as an issue in http://www.doctrine-project.org/jira/browse/DDC-1884