Hotfix/backport doctrine/instantiator#7 fix

See doctrine/instantiator#7 and doctrine/instantiator#8