Improve error diagnostic.