Fixed php code errors