Refactor regtests.sh.
Minor changes.