Changed offset to word_offset in write_int