Sync all patches with latest rfc1867 code