Fix a flat type mapping issue when a referenced record contains itself another reference to another record.