Fix random php errors