Tweaking some error handling.