Fix error handling a little.