Added some more debugging/error catching/tracing stuff. Logger should
now be more detailed when a document fails to be added.