Fixed bug in handling of BAM files