Fixup qsort problem, add LPC switch tests.