Thanks Christian Ullrich for the report and review. Backport of 8863c475c53f2b44113f25b749a124a5bf3a02f2 from master