Fix rewriterules