Handling collisions during reversing of dictionary