fixed bam file parsing