More tests and improvements to doctrine bundle