Fixed a panning code.