DCOM-194

Cleaned up version of #278 - fixes [DCOM-194](http://www.doctrine-project.org/jira/browse/DCOM-194)