fix fnmatch flag printing and add a few new (regression) test cases