bugfixes in bed conversion and bam handling