Fix crash on export