added failure handling for some bizarre cases from permutation data