fixes a bug in dict mapping that sometimes causes an erroneous identity map