Fixes a mercurial logic error.