Eliminate php errors in patch