Fix runCommand crash, return output and result