Fix bugs for rerun api