Don't fail on non existing key.
Let the users know if no selection was available.
Fix `NameError`.