Reading and writing the offset correctly.