Fix failing tests in PHP 5.2