Thanks to Ali Lotfi for the initial report and patch and Tim Graham for the review.
mentioned in commit 3aeb84df