Support nvm.
Fixed bugs for Darwin.