Fixing rewrite policy with proper if_() statements