Make error logging more readable and dump more info.

Code I've been using to poke at #416 and keep stashing.