Fix handling of types.