cherry-pick 3096aad4. fixes #60