Fix a couple bugs in the rerun script
Fixes to rerun sccript