Some minor fixes in alloy.py and exception handling in run_tests.py