Previous optimizations did not take into account the effects of large offsets.
Also script updates