Fixed two bugs in run script