Patched doctrine mistakes, and locked doctrine version (to make patch actual and compatible)