Fixed errors in runCommand