Integrate PRs #39 and #49 from v2.0.