Made script compatible with PHP 5.3.x and 5.4. Fixes #34