Rewrite internal paths