Fixed bugs in run