Better error reporting code, hopefully.