Minor fixes for better compatibility in uninstall method