Fixed code to detect COMPLETED/FAILED/KILLED state. Also fixed defect causing for loop to continue. pollStatus command will now return back up the call stack.
Merge pull request #77 from whitingjr/issue-#76

Fixed code to detect COMPLETED/FAILED/KILLED state.