Fixed tests (and code) for PHP 5.3.