Fixed issues related to PHP 5.3