Fixed failing build from PR #152 and PR #153

You should be able to pull this across all the stable branches.