[#88][#66][#76]export.py bugfixes and refactoring