Fix reverse and to-map