Fixing bugs in map editor