Fix some bugs in MapEditor
Tmp files are now deleted when a map is created