Map editor fix

Fixed some faults with the map editor.