Doctrine fixes

Change-Id: Ideb92531dfc8147016c8188471902f8cd63f7e5b