Make install script more idempotent