Fix some bugs with the editor and the map factory.