Backport fix #184