Fix install script bugs