Some fixes

Here some fixes, I have done during integration of libmodbus.