backport 5377c59; fixing #35