Thanks george_edison for the report and Claude Paroz for the patch. Backport of 63e6cd1bb3 from master