Pointers changed to guint8 type in order to calculate offset properly