Correcting string offsets