Simplified some code to fix a failing test for PHP 5.3