see above.
Created attachment 28796 [details] Proposed fix.
Comment on attachment 28796 [details] Proposed fix. Looking good.
Committed as r41897.