Make code compatible with PHP 5.3