This key function did not return the correct type, fixed the tests to pass the stricter type definition.