Made leaking memory when loading maps more difficult.