Fixed most of the error handling. Just a little more to go, and the job should be complete.