Fixed problem with illegal offsets