better error checking for sequtil.MatchBeginAndEnd
updates for PrepFiles