Minor fixes to runCommand