added check for unreachable modes and duplicate mode names