Fixed error in panning.