Fixed memory problems with panorama.