Fixed bug with building header table and when building hash data:

* Building header data was blinding adding new column headers and not
  handling existing duplicate headers. Will ignore duplicates from now on.
* Generating hash data on merging documents was catching COMException when
  COM wasn't being used anymore. Using correct index exception now.