Avoid a KeyNotFoundException
Fixed a test