Fix a crash when completing fields of a type