Minor formatting.
Code simplification for to and from dict.