BWA Samse now directly converts SAM to BAM. It seems that executeCommandCaptureOutput leads to unfinished bam files.