Fixed bugs in driver script