Fixed script
Pruned outdated TODOs [ci skip]
Small code tweak. No functional change intended
Fixed PHP 5.3
Added test
Synced to 811a64ed088e685d57bb250bc6cee535e17270f2
Synced to 811a64ed088e685d57bb250bc6cee535e17270f2