bug fixes for run_model.py