diff --git a/scripts/deployqt.py b/scripts/deployqt.py
index ea44599d8b91133fbe5d3a4bd7aded29360011f3..7f42eb322ace68ad857e424729464294f740334d 100755
--- a/scripts/deployqt.py
+++ b/scripts/deployqt.py
@@ -66,10 +66,10 @@ def which(program):
 
 def is_debug(fpath):
     # bootstrap exception
-    if fpath.endswith('QtCore4d.dll'):
+    if fpath.endswith('QtCore4d.dll') or fpath.endswith('QtCore5d.dll'):
         return True
     output = subprocess.check_output(['dumpbin', '/imports', fpath])
-    return output.find('QtCored4.dll') != -1
+    return output.find('QtCore4d.dll') != -1 or output.find('QtCore5d.dll') != -1
 
 def is_debug_build(install_dir):
     return is_debug(os.path.join(install_dir, 'bin', 'qtcreator.exe'))
@@ -175,9 +175,11 @@ def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, plugins
         target = os.path.join(install_dir, 'bin', plugin)
         if (os.path.exists(target)):
             shutil.rmtree(target)
-        shutil.copytree(os.path.join(qt_plugin_dir, plugin), target, ignore=copy_ignore_func, symlinks=True)
+        pluginPath = os.path.join(qt_plugin_dir, plugin)
+        if (os.path.exists(pluginPath)):
+            shutil.copytree(pluginPath, target, ignore=copy_ignore_func, symlinks=True)
 
-    print "Copying plugins:", imports
+    print "Copying imports:", imports
     for qtimport in imports:
         target = os.path.join(install_dir, 'bin', qtimport)
         if (os.path.exists(target)):
@@ -250,7 +252,7 @@ def main():
     QT_INSTALL_IMPORTS = readQmakeVar(qmake_bin, 'QT_INSTALL_IMPORTS')
     QT_INSTALL_TRANSLATIONS = readQmakeVar(qmake_bin, 'QT_INSTALL_TRANSLATIONS')
 
-    plugins = ['accessible', 'designer', 'iconengines', 'imageformats', 'sqldrivers']
+    plugins = ['accessible', 'designer', 'iconengines', 'imageformats', 'platforms', 'sqldrivers']
     imports = ['Qt', 'QtWebKit']
     tr_catalogs = ['assistant', 'designer', 'qt', 'qt_help']