Fixed issues when run with php-ng

Fixed several fails I met

thanks
I don't think these two changes are correct - you are removing the case for PHPNG again, and it was definitely failing without my changes.