Fix doctrine instance and config