miscellaneous tweaks, attempts to get export working