Index: src/Parser/MpqcParser.cpp
===================================================================
--- src/Parser/MpqcParser.cpp	(revision 4cbca0e8710efb136e5936feefe9dd2e7a865873)
+++ src/Parser/MpqcParser.cpp	(revision b6b3b2db19444a7431f85964bdb2550a87243367)
@@ -64,5 +64,5 @@
   boost::char_separator<char> sep("[]");
   boost::char_separator<char> angularsep("<>");
-  boost::char_separator<char> equalitysep("=");
+  boost::char_separator<char> equalitysep(" =");
   boost::char_separator<char> whitesep(" \t");
   ConvertTo<double> toDouble;
@@ -90,7 +90,11 @@
   //        throw MpqcParseException;
         tokenizer::iterator tok_iter = tokens.begin();
+        ASSERT(tok_iter != tokens.end(),
+            "MpqcParser::load() - missing token for MoleculeSection in line "+linestring+"!");
         std::stringstream whitespacefilter(*tok_iter++);
         std::string element;
-        whitespacefilter >> element;
+        whitespacefilter >> ws >> element;
+        ASSERT(tok_iter != tokens.end(),
+            "MpqcParser::load() - missing token for MoleculeSection in line "+linestring+"!");
         std::string vector = *tok_iter;
         tokenizer vectorcomponents(vector, whitesep);
@@ -111,15 +115,11 @@
     }
     if (MpqcSection) {
-      tokenizer tokens(linestring, equalitysep);
-      tokenizer::iterator tok_iter = tokens.begin();
-      std::stringstream whitespacefilter(*tok_iter++);
-      std::string key(*tok_iter++);
-      if (params.haveParam(key)) {
-        std::stringstream linestream(linestring);
-        linestream >> params;
-      } else if (linestring.find("mole<") != string::npos) { // get theory
+      if (linestring.find("mole<") != string::npos) { // get theory
         tokenizer tokens(linestring, angularsep);
         tokenizer::iterator tok_iter = tokens.begin();
-        std::string value(*(++tok_iter));
+        ++tok_iter;
+        ASSERT(tok_iter != tokens.end(),
+            "MpqcParser::load() - missing token in brackets<> for mole< in line "+linestring+"!");
+        std::string value(*tok_iter);
         std::stringstream linestream("theory = "+value);
         linestream >> params;
@@ -127,7 +127,25 @@
         tokenizer tokens(linestring, angularsep);
         tokenizer::iterator tok_iter = tokens.begin();
-        std::string value(*(++tok_iter));
+        ++tok_iter;
+        ASSERT(tok_iter != tokens.end(),
+            "MpqcParser::load() - missing token in brackets<> for integrals< in line "+linestring+"!");
+        std::string value(*tok_iter);
         std::stringstream linestream("integration = "+value);
         linestream >> params;
+      } else if ((linestring.find("molecule") == string::npos) && (linestring.find("basis") == string::npos)){
+        // molecule and basis must not be parsed in this section
+        tokenizer tokens(linestring, equalitysep);
+        tokenizer::iterator tok_iter = tokens.begin();
+        ASSERT(tok_iter != tokens.end(),
+            "MpqcParser::load() - missing token before '=' for MpqcSection in line "+linestring+"!");
+        std::stringstream whitespacefilter(*tok_iter);
+        std::string key;
+        whitespacefilter >> ws >> key;
+        if (params.haveParam(key)) {
+          std::stringstream linestream(linestring);
+          linestream >> params;
+        } else { // unknown keys are simply ignored as long as parser is incomplete
+          DoLog(2) && (Log() << Verbose(2) << "INFO: '"+key+"' is unknown and ignored." << std::endl);
+        }
       }
     }
@@ -135,6 +153,11 @@
       tokenizer tokens(linestring, equalitysep);
       tokenizer::iterator tok_iter = tokens.begin();
+      ASSERT(tok_iter != tokens.end(),
+          "MpqcParser::load() - missing token for BasisSection in line "+linestring+"!");
       std::string key(*tok_iter++);
+      ASSERT(tok_iter != tokens.end(),
+          "MpqcParser::load() - missing value for BasisSection after key "+key+" in line "+linestring+"!");
       std::string value(*tok_iter);
+      tok_iter++;
       // TODO: use exception instead of ASSERT
       ASSERT(tok_iter == tokens.end(),
@@ -148,6 +171,11 @@
       tokenizer tokens(linestring, equalitysep);
       tokenizer::iterator tok_iter = tokens.begin();
+      ASSERT(tok_iter != tokens.end(),
+          "MpqcParser::load() - missing token for AuxBasisSection in line "+linestring+"!");
       std::string key(*tok_iter++);
+      ASSERT(tok_iter != tokens.end(),
+          "MpqcParser::load() - missing value for BasisSection after key "+key+" in line "+linestring+"!");
       std::string value(*tok_iter);
+      tok_iter++;
       // TODO: use exception instead of ASSERT
       ASSERT(tok_iter == tokens.end(),
