Fixed complex datatype selection when a format is missing (null).
Cleanup.