Fix install script; add preinstall script