diff --git a/src/THcDetectorMap.cxx b/src/THcDetectorMap.cxx
index 6245ba85fdc0da945c191213a8452a3a181a6c22..9247259386aa5a081256e4194625841f30fb486b 100644
--- a/src/THcDetectorMap.cxx
+++ b/src/THcDetectorMap.cxx
@@ -283,7 +283,7 @@ void THcDetectorMap::Load(const char *fname)
     if((pos=line.find_first_of("=")) != string::npos) { // Setting parameter
       strcpy(varname, (line.substr(0,pos)).c_str());
       Int_t valuestartpos = pos+1;
-      UInt_t commapos = line.find_first_of(",");
+      Int_t commapos = line.find_first_of(",");
       Int_t value;
       Int_t value2 = -1;
       if(commapos != string::npos) {