diff --git a/.gitignore b/.gitignore
index 1f75c7a8415e355c18cf8f4ca449ad435e4bf015..c66a88ce3100ddf3e51ae4009f864a4015a7c35c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -238,3 +238,6 @@ src/xml/lib/
 *.dep
 *.map
 work
+
+# Generated static plugin import sources
+*_plugin_import.cpp
diff --git a/dist/changes-5.0.1 b/dist/changes-5.0.1
new file mode 100644
index 0000000000000000000000000000000000000000..cc5a6704b450c155ddc3469f9ebbaa6045ba4f79
--- /dev/null
+++ b/dist/changes-5.0.1
@@ -0,0 +1,51 @@
+Qt 5.0.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.0.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+  http://qt-project.org/doc/qt-5.0/
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+  http://bugreports.qt-project.org/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+
+****************************************************************************
+*                           General                                        *
+****************************************************************************
+
+General Improvements
+--------------------
+
+Third party components
+----------------------
+
+****************************************************************************
+*                          Library                                         *
+****************************************************************************
+
+
+****************************************************************************
+*                      Platform Specific Changes                           *
+****************************************************************************
+
+
+****************************************************************************
+*                      Compiler Specific Changes                           *
+****************************************************************************
+
+
+****************************************************************************
+*                          Tools                                           *
+****************************************************************************
+
+
+****************************************************************************
+*                          Plugins                                         *
+****************************************************************************
+
diff --git a/src/xmlpatterns/api/qcoloroutput_p.h b/src/xmlpatterns/api/qcoloroutput_p.h
index 864b90d99111d5b258e4627cb6cb67190d870633..f02a4506a58f5f24129a06b07ddaf383b292a3d4 100644
--- a/src/xmlpatterns/api/qcoloroutput_p.h
+++ b/src/xmlpatterns/api/qcoloroutput_p.h
@@ -70,8 +70,8 @@ namespace QPatternist
             ForegroundShift = 10,
             BackgroundShift = 20,
             SpecialShift    = 20,
-            ForegroundMask  = ((1 << ForegroundShift) - 1) << ForegroundShift,
-            BackgroundMask  = ((1 << BackgroundShift) - 1) << BackgroundShift
+            ForegroundMask  = 0x1f << ForegroundShift,
+            BackgroundMask  = 0x7 << BackgroundShift
         };
 
     public:
diff --git a/src/xmlpatterns/expr/qexpression.cpp b/src/xmlpatterns/expr/qexpression.cpp
index b87f0941d3c83004c2424a2d0d2d36f96ead246e..f469d89f30940417b8fb8eab49f3d678bc784731 100644
--- a/src/xmlpatterns/expr/qexpression.cpp
+++ b/src/xmlpatterns/expr/qexpression.cpp
@@ -136,7 +136,6 @@ Expression::Ptr Expression::invokeOptimizers(const Expression::Ptr &expr,
     }
 
     const OptimizationPass::List::const_iterator passEnd(opts.constEnd());
-    const OptimizationPass::List::const_iterator end(opts.constEnd());
     OptimizationPass::List::const_iterator passIt(opts.constBegin());
 
     for(; passIt != passEnd; ++passIt) /* Invoke each optimization pass. */
@@ -151,7 +150,6 @@ Expression::Ptr Expression::invokeOptimizers(const Expression::Ptr &expr,
             continue;
         }
 
-        const ExpressionIdentifier::List::const_iterator idEnd(pass->operandIdentifiers.constEnd());
         ExpressionIdentifier::List::const_iterator idIt(pass->operandIdentifiers.constBegin());
         const Expression::List ops(expr->operands());
         const Expression::List::const_iterator opEnd(ops.constEnd());
diff --git a/src/xmlpatterns/projection/qdocumentprojector.cpp b/src/xmlpatterns/projection/qdocumentprojector.cpp
index 390329b1808b771f5a81390c193a813d187f82e6..fe768384a1509be011ce3d794558e3544e10f53b 100644
--- a/src/xmlpatterns/projection/qdocumentprojector.cpp
+++ b/src/xmlpatterns/projection/qdocumentprojector.cpp
@@ -58,7 +58,7 @@ DocumentProjector::DocumentProjector(const ProjectedExpression::Vector &paths,
     Q_ASSERT(m_receiver);
 }
 
-void DocumentProjector::startElement(const QXmlName name)
+void DocumentProjector::startElement(const QXmlName &name)
 {
     Q_UNUSED(name);
 
@@ -165,14 +165,14 @@ void DocumentProjector::endElement()
     }
 }
 
-void DocumentProjector::attribute(const QXmlName name,
-                                  const QString &value)
+void DocumentProjector::attribute(const QXmlName &name,
+                                  const QStringRef &value)
 {
     Q_UNUSED(name);
     Q_UNUSED(value);
 }
 
-void DocumentProjector::namespaceBinding(const QXmlName nb)
+void DocumentProjector::namespaceBinding(const QXmlName &nb)
 {
     Q_UNUSED(nb);
 }
@@ -184,12 +184,12 @@ void DocumentProjector::comment(const QString &value)
     Q_UNUSED(value);
 }
 
-void DocumentProjector::characters(const QString &value)
+void DocumentProjector::characters(const QStringRef &value)
 {
     Q_UNUSED(value);
 }
 
-void DocumentProjector::processingInstruction(const QXmlName name,
+void DocumentProjector::processingInstruction(const QXmlName &name,
                                               const QString &value)
 {
     Q_ASSERT_X(!value.contains(QLatin1String("?>")), Q_FUNC_INFO,
diff --git a/src/xmlpatterns/projection/qdocumentprojector_p.h b/src/xmlpatterns/projection/qdocumentprojector_p.h
index b15a69949b3f54bcfef63d8a86d04dafa484dbf4..2a5d411dce05674d78c843ca99e979209f9bc9d7 100644
--- a/src/xmlpatterns/projection/qdocumentprojector_p.h
+++ b/src/xmlpatterns/projection/qdocumentprojector_p.h
@@ -72,19 +72,19 @@ namespace QPatternist
         DocumentProjector(const ProjectedExpression::Vector &paths,
                           QAbstractXmlReceiver *const receiver);
 
-        virtual void namespaceBinding(const QXmlName nb);
+        virtual void namespaceBinding(const QXmlName &nb);
 
-        virtual void characters(const QString &value);
+        virtual void characters(const QStringRef &value);
         virtual void comment(const QString &value);
 
-        virtual void startElement(const QXmlName name);
+        virtual void startElement(const QXmlName &name);
 
         virtual void endElement();
 
-        virtual void attribute(const QXmlName name,
-                               const QString &value);
+        virtual void attribute(const QXmlName &name,
+                               const QStringRef &value);
 
-        virtual void processingInstruction(const QXmlName name,
+        virtual void processingInstruction(const QXmlName &name,
                                            const QString &value);
 
         virtual void item(const Item &item);
diff --git a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
index aa6f9783dddcd38f9d43689d5d2a21c3aaf5866f..548654ec38c1da1b4873e2d9077cca7ad32ae940 100644
--- a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
+++ b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
@@ -185,6 +185,8 @@ template <typename TransitionType>
 template <typename InputType>
 bool XsdStateMachine<TransitionType>::inputEqualsTransition(InputType input, TransitionType transition) const
 {
+    Q_UNUSED(input);
+    Q_UNUSED(transition);
     return false;
 }