Changes for compatability with PHP 5.3