Fixed sign bit error on z_offset