fix condition in assertion to prevent random crashes: a.keys() == b.keys() is not the same as set(a) == set(b)