Fix rewritebase