Fix a bug with nested record definitions