Index: pixelmap/Pixel.cc
===================================================================
--- pixelmap/Pixel.cc	(revision 9)
+++ pixelmap/Pixel.cc	(revision 12)
@@ -2,6 +2,6 @@
 #include <iostream>
 
-Pixel::Pixel() : _DRSboard(-1), _DRSchip(-1), _DRSchannel(-1),
-		 _HVboard(-1), _HVchain(-1), _HVchannel(-1) { }
+Pixel::Pixel() : _DRSboard(999999999), _DRSchip(999999999), _DRSchannel(999999999),
+		 _HVboard(999999999), _HVchain(999999999), _HVchannel(999999999) { }
 
 Pixel::Pixel(unsigned int DRSboard, unsigned int DRSchip, unsigned int DRSchannel,
Index: pixelmap/PixelMap.cc
===================================================================
--- pixelmap/PixelMap.cc	(revision 9)
+++ pixelmap/PixelMap.cc	(revision 12)
@@ -4,4 +4,5 @@
 #include <cstring>
 #include <cstdlib>
+#include <cctype>
 
 PixelMap::PixelMap() {
@@ -27,5 +28,5 @@
     std::cout<<"Reading mapping file: "<<filename<<std::endl<<std::endl;
 
-    if (!infile.good()){
+    if (!infile.good()) {
 	std::cerr<<"ERROR in PixelMap::ReadPixelMap: File "<<filename<<" cannot be found."<<std::endl;
     }
@@ -33,10 +34,10 @@
     while (infile.good()) {
 	
-	char line[256];
-
-	infile.getline(line, 256);
-
-	if(line[0] == '#') {
-	    if(verbose) {
+	char line[1024];
+
+	infile.getline(line, 1024);
+
+	if (line[0] == '#') {
+	    if (verbose) {
 		std::cout << "Ignoring comment: " << line << std::endl;
 	    }
@@ -45,13 +46,36 @@
 	else {
 	    
-	    if(strlen(line)!=0){
+	    if (strlen(line)!=0) {
 		
 		char delim[] = ":";
-		char *name = NULL;
+		char *name = NULL; //unformated name before : tokens
+		char name2[256] = ""; //formated name without whitespaces
 		char *rest = NULL;
 		
 		name = strtok(line, delim);
 
-		if(strlen(name) > 4){
+		unsigned int count1 = 0; //count non-whitespace characters in name
+		unsigned int count2 = 0; //count number of - in name
+
+		for (unsigned int i = 0; i < strlen(name); i++) {
+
+		    if ( !(isspace(name[i])) ) {
+
+			name2[count1] = name[i];
+			count1+=1;
+
+			if ( (name[i] == 45) ) {
+			    count2+=1;
+			}
+
+		    }
+
+		}
+
+		if (verbose) {
+		    std::cout << "Formated pixel name: " << name2 << std::endl;
+		}
+
+		if( (count1 > 4) && (count1 < 7) && (count2 == 2) ) {
 
 		    rest = strtok(NULL, delim);
@@ -66,6 +90,6 @@
 			unsigned int HVchannel = (unsigned int)strtod(rest, &rest);
 
-			pixelmap[name] = new Pixel(DRSboard, DRSchip, DRSchannel,
-						   HVboard, HVchain, HVchannel);
+			pixelmap[name2] = new Pixel(DRSboard, DRSchip, DRSchannel,
+						    HVboard, HVchain, HVchannel);
 
 		    }
@@ -75,5 +99,15 @@
 		else {
 
-		    std::cout << "ERROR in PixelMap::ReadPixelMap: Wrong pixel name: " << name << "-> pixel not initialized" << std::endl;
+		    std::cout << "ERROR in PixelMap::ReadPixelMap: Wrong pixel name: " << name2 << " -> pixel not initialized" << std::endl;
+
+		}
+
+	    } 
+
+	    else {
+
+		if(verbose){
+
+		    std::cout << "Skipping empty line" << std::endl;
 
 		}
