more log.ref & test fixes
now -flat checks subdirectories
-flat needs subdirectories to having been checked first