Fixed bugs in run-with-mps.sh