index_of() could return undefined which is then passed to preflist(). Sure, the test would fail, but it might be nice to catch it earlier.