Fixes to DB exporter logic