Thanks Tim Graham for the review and suggestions. d19109fd37 from master.
d19109fd37
Thank-you Taavi Taijala for the draft patch! Backport of 7058b595b6 from master
7058b595b6