PHP 5.3.1 compatibility fix