diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
index 7b3ca0c888c0ccdcb3a99368bee00b669a605eb7..80da35337ad81a1db620525f72db42ec89db3bf8 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
@@ -1064,13 +1064,13 @@ void AbstractMaemoRunControl::startDeployment(bool forDebugging)
 void AbstractMaemoRunControl::deploy()
 {
     if (!deployables.isEmpty()) {
-        QPair<QString, QString> pair = deployables.at(0);
+        QPair<QString, QString> pair = deployables.first();
         emit addToOutputWindow(this, tr("File to deploy: %1.").arg(pair.first));
 
         QStringList cmdArgs;
         cmdArgs << "-P" << port() << options() << pair.first << (devConfig.uname
             + "@" + devConfig.host + ":" + remoteDir());
-        deployProcess.setWorkingDirectory(QFileInfo(pair.second).absolutePath());
+        deployProcess.setWorkingDirectory(pair.second);
 
         deployProcess.start(runConfig->scpCmd(), cmdArgs);
         if (!deployProcess.waitForStarted()) {
@@ -1100,10 +1100,14 @@ void AbstractMaemoRunControl::deployProcessFinished()
     if (deployProcess.exitCode() == 0) {
         emit addToOutputWindow(this, tr("Target deployed."));
         success = true;
-        if (deployingExecutable)
+        if (deployingExecutable) {
             runConfig->wasDeployed();
-        if (deployingDumperLib)
+            deployingExecutable = false;
+        }
+        if (deployingDumperLib) {
             runConfig->debuggingHelpersDeployed();
+            deployingDumperLib = false;
+        }
         deployables.removeFirst();
     } else {
         emit error(this, tr("Deployment failed."));