fixed keyring-related memory leaks