Missing check for restoring preferences to only take place when actually
being uninstalled.
Minor cleanup / comments.