diff --git a/src/xmlpatterns/data/qabstractdatetime.cpp b/src/xmlpatterns/data/qabstractdatetime.cpp
index 2b14fd95ef51b72d7ef1fb2414c455437e7ae614..92d317ddb22857c4b0bb06e10eae9caf0e73cada 100644
--- a/src/xmlpatterns/data/qabstractdatetime.cpp
+++ b/src/xmlpatterns/data/qabstractdatetime.cpp
@@ -40,6 +40,7 @@
 ****************************************************************************/
 
 #include <QStringList>
+#include <QTimeZone>
 
 #include "qbuiltintypes_p.h"
 #include "qitem_p.h"
@@ -388,6 +389,11 @@ void AbstractDateTime::copyTimeSpec(const QDateTime &from,
             Q_ASSERT(to.timeSpec() == Qt::OffsetFromUTC);
             return;
         }
+        case Qt::TimeZone:
+        {
+            to.setTimeZone(from.timeZone());
+            return;
+        }
     }
 }
 
diff --git a/src/xmlpatterns/data/qderivedinteger_p.h b/src/xmlpatterns/data/qderivedinteger_p.h
index 621f06107914e9124eef99e5c4fbab7e43d16de6..241abac879b63d789a13b508aa9eb5f775f3e61f 100644
--- a/src/xmlpatterns/data/qderivedinteger_p.h
+++ b/src/xmlpatterns/data/qderivedinteger_p.h
@@ -393,6 +393,8 @@ namespace QPatternist
              * reason get a linker error with GCC. Using this temporary
              * variable solves it. */
             const StorageType minimum = minInclusive;
+            // MSVC2010 complains that this is initialised but not referenced.
+            Q_UNUSED(minimum)
 
             if((limitsUsage & LimitUpwards) &&
                num > maxInclusive)
diff --git a/src/xmlpatterns/parser/qquerytransformparser.cpp b/src/xmlpatterns/parser/qquerytransformparser.cpp
index 6b9194c46dba3f4ce9dd0d240f3d22a07952f96a..0969701b4d5329d2b2def351c3d33d3c36c5b7c5 100644
--- a/src/xmlpatterns/parser/qquerytransformparser.cpp
+++ b/src/xmlpatterns/parser/qquerytransformparser.cpp
@@ -3368,6 +3368,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, parseInfo)
     ParserContext *const parseInfo;
 #endif
 {
+  YYUSE (yytype);
   YYUSE (yyvaluep);
   YYUSE (yylocationp);
   YYUSE (parseInfo);
@@ -3375,13 +3376,6 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, parseInfo)
   if (!yymsg)
     yymsg = "Deleting";
   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
-  switch (yytype)
-    {
-
-      default:
-	break;
-    }
 }
 
 
diff --git a/tests/auto/qxmlquery/pushBaselines/allAtomics.ref b/tests/auto/qxmlquery/pushBaselines/allAtomics.ref
index 71ecaaaea8878be9c3710ffb9834010b6d875d36..77aceaafc5de12dc8f6501ae11a74d319e9ed564 100644
--- a/tests/auto/qxmlquery/pushBaselines/allAtomics.ref
+++ b/tests/auto/qxmlquery/pushBaselines/allAtomics.ref
@@ -1,6 +1,6 @@
 startOfSequence()
 atomicValue(xs:untypedAtomic)
-atomicValue(2002-10-10T23:02:11.000Z)
+atomicValue(2002-10-10T23:02:11Z)
 atomicValue(2002-10-10)
 atomicValue()
 atomicValue()