Map editor crash fix