Cherrypick fix from PR #50, if needed.
Cherrypick fix from PR #50, if needed.