Clear rules when switching route types
Fix uri resolution from headers when no uri is provided