Fixed a memory leak and fixed the threading issue in the map screen that shows a popup on the wrong screen.