Fixed php errors