diff --git a/languages/cpp/parser/parsesession.cpp b/languages/cpp/parser/parsesession.cpp
index 9fcb91f..645fde4 100644
--- a/languages/cpp/parser/parsesession.cpp
+++ b/languages/cpp/parser/parsesession.cpp
@@ -171,12 +171,6 @@ void ParseSession::setContents(const PreprocessedContents& contents, rpp::Locati
 void ParseSession::setContentsAndGenerateLocationTable(const PreprocessedContents& contents)
 {
   m_contents = contents;
-  ///@todo We need this in the lexer, the problem is that we copy the vector when doing this
-  m_contents.append(0);
-  m_contents.append(0);
-  m_contents.append(0);
-  m_contents.append(0);
-
   m_locationTable = new rpp::LocationTable(m_contents);
 }
 
diff --git a/languages/cpp/parser/tests/test_parser.cpp b/languages/cpp/parser/tests/test_parser.cpp
index de5f804..7d21ad1 100644
--- a/languages/cpp/parser/tests/test_parser.cpp
+++ b/languages/cpp/parser/tests/test_parser.cpp
@@ -120,13 +120,11 @@ private slots:
   {
     QByteArray templatetest("template <int N, int M> struct SeriesAdder{ enum { value = N + SeriesAdder< 0 >::value }; };");
     pool mem_pool;
+    int problemCount = control.problems().count();
     TranslationUnitAST* ast = parse(templatetest, &mem_pool);
     QVERIFY(ast != 0);
     QVERIFY(ast->declarations != 0);
-    for (int i = 0; i < control.problems().count(); i++)
-    {
-      QVERIFY(control.problems().at(i)->description() == "Unexpected end of file");
-    }
+    QCOMPARE(control.problems().count(), problemCount);
   }
   
   void testManyComparisons()
@@ -153,9 +151,10 @@ private slots:
   {
     QByteArray stuff("foo bar !!! nothing that really looks like valid c++ code");
     pool mem_pool;
+    int problemCount = control.problems().count();
     TranslationUnitAST *ast = parse(stuff, &mem_pool);
     QVERIFY(ast->declarations == 0);
-    QVERIFY(control.problems().count() > 3);
+    QVERIFY(control.problems().count() > problemCount + 3);
   }
 
   void testPartialParseFail() {
@@ -389,7 +388,7 @@ private slots:
     QCOMPARE(formatter.formatComment(it->element->comments, lastSession), QByteArray("Just a simple comment"));
 
     QList<KDevelop::ProblemPointer> problem_list = control.problems();
-    QCOMPARE(problem_list.size(), initial_size + 6); // 5 to-dos + additional 'Unexpected end of file' problem
+    QCOMPARE(problem_list.size(), initial_size + 5); // 5 to-dos
     KDevelop::ProblemPointer problem = problem_list[initial_size];
     QCOMPARE(problem->description(), QString("FIXME comment"));
     QCOMPARE(problem->source(), KDevelop::ProblemData::ToDo);
@@ -723,7 +722,7 @@ private slots:
     QVERIFY(hasKind(ast, AST::Kind_FunctionDefinition));
     FunctionDefinitionAST* funcAst = static_cast<FunctionDefinitionAST*>(getAST(ast, AST::Kind_FunctionDefinition));
     QVERIFY(hasKind(funcAst, AST::Kind_ExpressionOrDeclarationStatement));
-    ExpressionOrDeclarationStatementAST* ambAst = static_cast<ExpressionOrDeclarationStatementAST*>(getAST(funcAst, AST::Kind_ExpressionOrDeclarationStatement));
+    QVERIFY(static_cast<ExpressionOrDeclarationStatementAST*>(getAST(funcAst, AST::Kind_ExpressionOrDeclarationStatement)));
     QVERIFY(hasKind(funcAst, AST::Kind_FunctionCall));
     QVERIFY(hasKind(funcAst, AST::Kind_InitDeclarator));
   }
@@ -756,25 +755,21 @@ private slots:
 
     QByteArray switchTest("int main() { switch(0); }");
     parse(switchTest, &mem_pool);
-    QCOMPARE(control.problems().count(), ++problemCount);
     QByteArray switchTest2("int main() { switch (0) case 0: if (true) ; else return 1; }");
     parse(switchTest2, &mem_pool);
-    QCOMPARE(control.problems().count(), ++problemCount);
     QByteArray switchTest3("int main() { switch (0) { case 0: if (true) ; else return 1; } }");
     parse(switchTest3, &mem_pool);
-    QCOMPARE(control.problems().count(), ++problemCount);
     QByteArray switchTest4("int main() { switch (0) while(true) return false; }");
     parse(switchTest4, &mem_pool);
-    QCOMPARE(control.problems().count(), ++problemCount);
     QByteArray switchTest5("int main() { switch (0) { case 0: return 0; } }");
     parse(switchTest5, &mem_pool);
-    QCOMPARE(control.problems().count(), ++problemCount);
+    QCOMPARE(control.problems().count(), problemCount);
   }
 
 private:
   ParseSession* lastSession;
 
-  TranslationUnitAST* parse(const QByteArray& unit, pool* mem_pool)
+  TranslationUnitAST* parse(const QByteArray& unit, pool* /*mem_pool*/)
   {
     Parser parser(&control);
     lastSession = new ParseSession();
