Workaround for the inference issue for nested records.

Review by @hubertp