Applying fixes as commented on doctrine/common#247