Fixed some exit issues in execCommand