Structural changes. Moved the type conversions into the various type
constructors. More idiomatic.