fixed two big issues: - was modifying string in place, causing dup check
to fail for same schemes; - was creating new dup table for each mode
length, causing same modes of differing lengths to appear different