Fix PHP 5.3 compatibility

Had to do this ugly change to make it work with PHP 5.3...