Improved error handling in export commands, so they let you know you need to save the doc before exporting.

This will (hopefully) solve all export problems for @uxward :)