Fixing minor bug in ExportFunction