Add some tests to cover the flags parameter on sub/subn