Fixed the processing of a directory of magic files which was very
broken.  Thanks to nfx.