I have not destruction-tested, but I am worried by what seems to be a typo in line 1510 (in class WriteMulipleRegisters). The maximum limit is set to 0x7B0 - but I believe what is intended is 0x007B. The MODBUS Application Protocol page 30 seems clear.
I think code may have been copied and pasted from line 1300 (in class WriteMultipleCoils).