Fixing fatal errors in PHP 5.4