fixed minor bug in guessing basename for lists