Cleanup of invalidated keys from settings file.