​Attached, ​an updated patch set which fixes a couple of bugs I found, and adds one more patch to remove an unused variable.

--