Converted -i and -I to use commands, and fixed sort/join incompatibilities