Added some bug fixes to export email button.