Fixed compatibility with php-5.2