Handle OptionalType and NonNullableType types. Better error reporting.