diff --git a/src/bamToBed/bamToBed.cpp b/src/bamToBed/bamToBed.cpp
index 665fad47d800ce8e270f4e6b32ea57b5b3a94652..fb56b2736aab59f6e0b63f3ebd4227257f06617c 100755
--- a/src/bamToBed/bamToBed.cpp
+++ b/src/bamToBed/bamToBed.cpp
@@ -187,7 +187,7 @@ void PrintBed(const BamAlignment &bam,  const RefVector &refs, bool useEditDista
 void PrintBedPE(const BamAlignment &bam,  const RefVector &refs, bool useEditDistance) {
 
 	string chrom1, chrom2, strand1, strand2;
-	unsigned int start1, start2, end1, end2;
+	int start1, start2, end1, end2;
 	start1 = start2 = end1 = end2 = -1;
 	chrom1 = chrom2 = strand1 = strand2 = ".";