Fix uninstall logic for deploy