Fixed a bug when disposing a map.