Fixed compatibility issue with PHP 5.2