Fix compatibility issues with PHP 5.3.3