Thanks Denis Martinez for the report and initial patch, and Sergey Kolosov for bringing the patch up to date.