Fix to make Generator compatible with PHP 5.3.3