Added a number-of-fields check.