Further enhancements in export_database script.