Made dosearch check the output file after every refine run completes. Empty files after a refine error were causing problems