Fixes for mercurial