Fixed overflow bug in twi.c