A few minor tweaks to support different versions of PHP