Backport fix issue #5