Implemented some more error checking and text error messages.

Signed-off-by: Christian Gunderman <christian@sonofboss.cwru.edu>