Improve error logging for issue #6.