Fix for PHP prior to 5.3.9