fix #5123
Merge pull request #6300 from ivarne/release-0.2

[Backport] fix for #5123