diff --git a/apps/jetty/java/src/net/i2p/servlet/I2PDefaultServlet.java b/apps/jetty/java/src/net/i2p/servlet/I2PDefaultServlet.java
index c4e8bdd28d3dca43a0c6894867c308e3e5450354..eb2dd62c8986fe408ba03163f04f3fe3e563564d 100644
--- a/apps/jetty/java/src/net/i2p/servlet/I2PDefaultServlet.java
+++ b/apps/jetty/java/src/net/i2p/servlet/I2PDefaultServlet.java
@@ -248,9 +248,9 @@ public class I2PDefaultServlet extends DefaultServlet
      * Copied unchanged from Resource.java
      *
      * Encode any characters that could break the URI string in an HREF.
-     * Such as <a href="/path/to;<script>Window.alert("XSS"+'%20'+"here");</script>">Link</a>
+     * Such as &lt;a href="/path/to;&lt;script&gt;Window.alert("XSS"+'%20'+"here");&lt;/script&gt;"&gt;Link&lt;/a&gt;
      * 
-     * The above example would parse incorrectly on various browsers as the "<" or '"' characters
+     * The above example would parse incorrectly on various browsers as the "&lt;" or '"' characters
      * would end the href attribute value string prematurely.
      * 
      * @param raw the raw text to encode.
diff --git a/debian-alt/doc/debian-build.txt b/debian-alt/doc/debian-build.txt
index 38f7805d4e42fe30c92d362bdf99b678bc5d7552..3182f84e8c5f85a5631d353e8ee3408d433fc018 100644
--- a/debian-alt/doc/debian-build.txt
+++ b/debian-alt/doc/debian-build.txt
@@ -75,8 +75,8 @@ reprepro -v update precise
 reprepro -v update trusty
 reprepro -v update vivid
 reprepro -v update xenial
-reprepro -v update yakkety
 reprepro -v update zesty
+reprepro -v update artful
 # todo when set up
 # To add or remove distributions, edit /var/www/debian/conf/distributions
 # and /var/www/debian/conf/updates
@@ -89,22 +89,25 @@ reprepro -v update zesty
 # Note that syntax is reprepro copysrc TO FROM package!
 reprepro -v copysrc wheezy precise i2p
 
-# To copy libjbigi-jni i386 (only) from trusty to jessie:
+# To copy trusty to jessie:
 # Note that syntax is reprepro copysrc TO FROM package!
-reprepro -v -A i386 copy jessie trusty libjbigi-jni
+reprepro -v copysrc jessie trusty i2p
 
-# To copy jessie to sid:
+# To copy xenial to stretch:
 # Note that syntax is reprepro copysrc TO FROM package!
-reprepro -v copysrc sid jessie i2p
+reprepro -v copysrc stretch xenial i2p
 
 # install in the architectures not copied from ubuntu
 # 'flood' should do this but forgot how, can't make it work any more
-reprepro -v -A 'armel|armhf|powerpc' includedeb wheezy i2p_0.9.xxp-1ubuntu1_all.deb
-reprepro -v -A 'armel|armhf|powerpc' includedeb wheezy i2p-doc_0.9.xxp-1ubuntu1_all.deb
-reprepro -v -A 'armel|armhf|powerpc' includedeb wheezy i2p-router_0.9.xxp-1ubuntu1_all.deb
-reprepro -v -A 'armel|armhf|powerpc' includedeb jessie i2p_0.9.xx-1ubuntu1_all.deb
-reprepro -v -A 'armel|armhf|powerpc' includedeb jessie i2p-doc_0.9.xx-1ubuntu1_all.deb
-reprepro -v -A 'armel|armhf|powerpc' includedeb jessie i2p-router_0.9.xx-1ubuntu1_all.deb
+reprepro -v -A 'armel|armhf|powerpc' includedeb wheezy i2p_0.9.xxp-1precise1_all.deb
+reprepro -v -A 'armel|armhf|powerpc' includedeb wheezy i2p-doc_0.9.xxp-1precise1_all.deb
+reprepro -v -A 'armel|armhf|powerpc' includedeb wheezy i2p-router_0.9.xxp-1precise1_all.deb
+reprepro -v -A 'armel|armhf|powerpc' includedeb jessie i2p_0.9.xxp-1trusty1_all.deb
+reprepro -v -A 'armel|armhf|powerpc' includedeb jessie i2p-doc_0.9.xxp-1trusty1_all.deb
+reprepro -v -A 'armel|armhf|powerpc' includedeb jessie i2p-router_0.9.xxp-1trusty1_all.deb
+reprepro -v -A 'armel|armhf' includedeb stretch i2p_0.9.xx-1ubuntu1_all.deb
+reprepro -v -A 'armel|armhf' includedeb stretch i2p-doc_0.9.xx-1ubuntu1_all.deb
+reprepro -v -A 'armel|armhf' includedeb stretch i2p-router_0.9.xx-1ubuntu1_all.deb
 reprepro -v -A 'armel|armhf' includedeb sid i2p_0.9.xx-1ubuntu1_all.deb
 reprepro -v -A 'armel|armhf' includedeb sid i2p-doc_0.9.xx-1ubuntu1_all.deb
 reprepro -v -A 'armel|armhf' includedeb sid i2p-router_0.9.xx-1ubuntu1_all.deb
diff --git a/debian-alt/precise/changelog b/debian-alt/precise/changelog
index 590957b562d7017e20254019dad78158bbfba7e4..b1558b2de6d79e56e92a5b64834fde977fa0507b 100644
--- a/debian-alt/precise/changelog
+++ b/debian-alt/precise/changelog
@@ -1,3 +1,9 @@
+i2p (0.9.31p-1~precise+1) precise; urgency=medium
+
+  * Backport to Precise
+
+ -- zzz on i2p (key signing) <zzz@i2pmail.org>  Wed, 09 Aug 2017 12:12:12 +0000
+
 i2p (0.9.30p-1~precise+1) precise; urgency=medium
 
   * Backport to Precise
diff --git a/debian-alt/trusty/changelog b/debian-alt/trusty/changelog
index 4deb2882a7a374f819194314f553980103297656..6ca1fcbcff89ac9e6d5fb309575358f091dc2d4d 100644
--- a/debian-alt/trusty/changelog
+++ b/debian-alt/trusty/changelog
@@ -1,3 +1,9 @@
+i2p (0.9.31p-2~trusty+1) trusty; urgency=medium
+
+  * Backport to Trusty
+
+ -- zzz on i2p (key signing) <zzz@i2pmail.org>  Wed, 09 Aug 2017 12:12:12 +0000
+
 i2p (0.9.30p-2~trusty+1) trusty; urgency=medium
 
   * Restore systemd usage
diff --git a/debian-alt/xenial/changelog b/debian-alt/xenial/changelog
index 3c78095d49b0a8edfeb16793ee2c40098929b13d..ee4debe5e8339fc51bcdfc602493620c8014c660 100644
--- a/debian-alt/xenial/changelog
+++ b/debian-alt/xenial/changelog
@@ -1,3 +1,9 @@
+i2p (0.9.31-1ubuntu1) xenial; urgency=medium
+
+  * New upstream version 0.9.31
+
+ -- zzz on i2p (key signing) <zzz@i2pmail.org>  Wed, 09 Aug 2017 12:12:12 +0000
+
 i2p (0.9.30-3ubuntu1) xenial; urgency=medium
 
   * New upstream version 0.9.30
diff --git a/debian/patches/0001-path-substitution.patch b/debian/patches/0001-path-substitution.patch
index 275948aa652316ed63eb4135f042e6817487226d..d96b0ca465a848b65d780aa654c2b4ff72a01cb6 100644
--- a/debian/patches/0001-path-substitution.patch
+++ b/debian/patches/0001-path-substitution.patch
@@ -554,7 +554,7 @@ Index: b/installer/resources/locale/po/messages_sv.po
 --- a/installer/resources/locale/po/messages_sv.po
 +++ b/installer/resources/locale/po/messages_sv.po
 @@ -187,13 +187,13 @@ msgid "Request a Java thread dump if run
-  -@msgstr "Fråga efter en Java thread dump vid drift."
+ msgstr "Fråga efter en Java thread dump vid drift."
  
  #: ../i2prouter:1874
 -msgid "Please edit i2prouter and set the variable RUN_AS_USER"