Add MacOS support.
Fix minor bugs in completion install.