Bugfixes for Doctrine and new stuff