Absorb the KeyError, so that this function can be used as an elidable.

Update its use cases accordingly.