cherry-pick 3096aad4. fixes #60
merged 0.8.0beta1, 1 conflict