Fixes to panning with mouse