Fix issue 47
Created originally on Bitbucket by pnathan (Paul Nathan)
Changesets for this Pull Request have not been imported, because it had been already declined on Bitbucket. Marked as closed by the import user.
This solves issue relating to more recent hg internal refactoring.