Fixed NullPointerException when exporting data.