fixed to ensure last batch is actually flushed
changed test to walk directory without channel (faster)
added profiling flags to main prog as well