Fixed schema export and some bugs in desktop application export