Made the code compatible with PHP 5.3 as that's what the main server (currently) runs