Added wait flag to clear_output.