Minor changes to url rewriting