Added debugging code; fixed small samtools bug