fixed some copy-paste issues, php now generates correctly