Applied https://github.com/fixe/doctrine1/commit/c28c6e8e461c5b4198cc029622386750da9121ff