More fixes to i2c code