Fix PHP parse error
Fix more PHP parse errors
Fix undeclared variables