Making error handling a little safer.