PHP example bugs fixed