Fixed bugs in run scripts.