Modbus fixes

Minor fixes in the modbus handler