[FIX] fixed BAM writer
[FIX] fixed BAM I/O tests