Made changes to merging of temp bam files

Trying to fix some problem with the merging. I don't like the changes so
I think I'm going to revert back a commit.