diff --git a/geomagio/WebServiceUsage.py b/geomagio/WebServiceUsage.py
index 0a17eefa5385727a902c708c07c8cb1600c60a10..f72fdc438e373adc06b47ab37de44464fc0b912e 100644
--- a/geomagio/WebServiceUsage.py
+++ b/geomagio/WebServiceUsage.py
@@ -33,7 +33,7 @@ class WebServiceUsage(object):
             ids += "<code>" + obs_id + "</code>"
             if idx != len(observatories) - 1:
                 ids += ", "
-            if idx % 9 == 0 and idx is not 0:
+            if idx % 9 == 0 and idx != 0:
                 ids += "<br/>"
         usage_body = """
             <!doctype html>
diff --git a/geomagio/algorithm/SqDistAlgorithm.py b/geomagio/algorithm/SqDistAlgorithm.py
index b320945f3c6b74701f89ab2ee579a87a721f4520..12d99564ace71603650ad8124ecad728889cc507 100644
--- a/geomagio/algorithm/SqDistAlgorithm.py
+++ b/geomagio/algorithm/SqDistAlgorithm.py
@@ -221,7 +221,7 @@ class SqDistAlgorithm(Algorithm):
                 # state not correct
                 raise AlgorithmException(
                         'Inconsistent SQDist algorithm state' +
-                        ' state(%s, %s, %s, %s) <> process(%s, %s, %s, %s)' %
+                        ' process(%s, %s, %s, %s) <> state(%s, %s, %s, %s)' %
                                 (trace.stats.station,
                                 trace.stats.channel,
                                 trace.stats.delta,