Here is a new patch with the requested changes.