Fixed bug with map clearing.