fix lastByte offset