Clean up blocking until output is done