- fixes to run on older versions of PHP and/or on Mac OSX