Fixed a PHP 5.3 incompatibility. Also fixed a test case.