Fixed exception with parameter number mismatch in WriteRecords

Also added a unit test to be sure it works...
Merge branch 'write-records-parameter-mismatch'
WriteRecords signature, changed IEnumerable<> to IEnumerable