Improve debug logging to cover many previously opaque error conditions.  Also fix a typo in a message.