Fixing deprecation warnings in PHP 5.5