Forked so two outstanding pull requests can be merged into private version.