Removed some duplicate code in runtests.sh