Build samtools version and fix samtools bugs