Fixed and tested uninstallation code.