Make frequency shift behave correctly on buffer edges.