Fix bug with document merger
add some debug logging with logging module