Fix zoom/pan bug