diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index 375f322625e43b9b15478675d6934f31bba5773f..6d9b9f8d0e662c1248b6a27bbddc071e8d9091c4 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -164,12 +164,20 @@ protected:
         if (! symbol)
             return false;
 
-        else if (symbol == _declSymbol)
+        else if (symbol == _declSymbol) {
             return true;
 
-        else if (symbol->line() == _declSymbol->line() && symbol->column() == _declSymbol->column()) {
+        } else if (symbol->line() == _declSymbol->line() && symbol->column() == _declSymbol->column()) {
             if (! qstrcmp(symbol->fileName(), _declSymbol->fileName()))
                 return true;
+
+        } else if (symbol->isForwardClassDeclaration() && (_declSymbol->isClass() ||
+                                                           _declSymbol->isForwardClassDeclaration())) {
+            return true;
+
+        } else if (_declSymbol->isForwardClassDeclaration() && (symbol->isClass() ||
+                                                                symbol->isForwardClassDeclaration())) {
+            return true;
         }
 
         return false;
@@ -467,7 +475,21 @@ static void find_helper(QFutureInterface<Utils::FileSearchResult> &future,
     const QString sourceFile = QString::fromUtf8(symbol->fileName(), symbol->fileNameLength());
 
     QStringList files(sourceFile);
-    files += snapshot.dependsOn(sourceFile);
+
+    if (symbol->isClass() || symbol->isForwardClassDeclaration()) {
+        foreach (const Document::Ptr &doc, snapshot) {
+            if (doc->fileName() == sourceFile)
+                continue;
+
+            Control *control = doc->control();
+
+            if (control->findIdentifier(symbolId->chars(), symbolId->size()))
+                files.append(doc->fileName());
+        }
+    } else {
+        files += snapshot.dependsOn(sourceFile);
+    }
+
     qDebug() << "done in:" << tm.elapsed() << "number of files to parse:" << files.size();
 
     future.setProgressRange(0, files.size());
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
index c0e43169a6dd98d6d5d87994dc31923d08a6f162..81f111241547dfaafb7cc2822509d31b8c544551 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
@@ -209,9 +209,18 @@ static QString localExecutableFromPkgFile(const QString &pkgFileName, QString *e
     // "<SDK>/foo.exe"    - "!:\device_bin\foo.exe"
     const QRegExp exePattern = QRegExp(QLatin1String("^\"([^\"]+\\.exe)\" +-.*$"));
     Q_ASSERT(exePattern.isValid());
-    foreach(const QString &line, QString::fromLocal8Bit(pkgFile.readAll()).split(QLatin1Char('\n')))
-        if (exePattern.exactMatch(line))
-            return exePattern.cap(1);
+
+    foreach(const QString &line, QString::fromLocal8Bit(pkgFile.readAll()).split(QLatin1Char('\n'))) {
+        if (exePattern.exactMatch(line)) {
+            QString rc = exePattern.cap(1);
+#ifdef Q_OS_WIN
+            // Sometimes, the drive letter is missing. Use that of the pkg file
+            if (rc.at(0) == QLatin1Char('/'))
+                rc.insert(0, pkgFileName.left(2));
+#endif
+            return rc;
+        }
+    }
     *errorMessage = S60DeviceRunConfiguration::tr("Unable to find the executable in the package file %1.").arg(pkgFileName);
     return QString();
 }