Improve to- and from-dict transformations.