Improving error-handling.

It kind of sucks right now.