Fixes two compatibility issues with PHP 5.3.