BAM Converter: Lots of bugfixes and minor improvements