Add root option. Add path pattern replacement