Properly quote "$#" during test, and import compare.shlib