Fixed ESFM export (with proper indenting, etc.)