Cleaning up types.
More careful use of types.