Bug fixes for php generator