fixes rs/pushd#31

Cherry pick from the pull request #32