Type checking and upgrades for record writing.