diff --git a/group-connectivity.h b/group-connectivity.h
index 0199836d7abacb862f912e2058239b33962135da..3e00fb00b2ac286dcd8ebc3b6f44dc73d343db3e 100644
--- a/group-connectivity.h
+++ b/group-connectivity.h
@@ -47,7 +47,7 @@ struct Tester : public AbstractTester {
 # if !USE_NEXT_FORB
   size_t numForb;
 # endif
-  int edges;
+  size_t edges;
 
   std::vector<EdgeId> classEdges;
   std::vector< std::pair<EdgeId, Mapping> > nonClassEdges;
diff --git a/setup.py b/setup.py
index 18360a7997cc22f0dc7ff204483ee76e5c9a3501..28102c45074e78fd31b81aee9d8838ef7ea038f7 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,10 @@ setup(
     Extension("groupConnectivity",
       sources = ["groupConnectivity.pyx"],
       language="c++",
-      extra_compile_args=["-std=gnu++11", "-O2", "-funroll-loops"]
+      extra_compile_args=[
+        "-std=gnu++11", "-O2", "-funroll-loops", "-fwrapv",
+        "-Wall", "-fno-strict-aliasing"
+      ]
     )
   ])
 )
diff --git a/twoCuts.h b/twoCuts.h
index c42a9edbed1deee8dc80d653d622e98fd4249076..e644c33139676e9bd16ff7956f6e3608823a90ed 100644
--- a/twoCuts.h
+++ b/twoCuts.h
@@ -9,9 +9,9 @@ struct TwoCutInt {
   static const int num_classes = (Ring::size * (Ring::size - 1)) / 2;
 
   struct Tables {
-    char decodeMatrix[Ring::size][Ring::size];
-    struct { char a, b; } encodeTable[max_value];
-    char classMatrix[Ring::size][Ring::size];
+    signed char decodeMatrix[Ring::size][Ring::size];
+    struct { signed char a, b; } encodeTable[max_value];
+    signed char classMatrix[Ring::size][Ring::size];
 
     Tables() {
       encodeTable[0] = {1, 2};
@@ -30,7 +30,7 @@ struct TwoCutInt {
 
       memset(classMatrix, -1, sizeof(classMatrix));
 
-      struct { char a, b; } classTable[num_classes];
+      struct { signed char a, b; } classTable[num_classes];
       classTable[0] = {0, 1};
 
       for (int i = 1; i < num_classes; i++) {
@@ -59,7 +59,6 @@ struct TwoCutInt {
   }
 
   inline int getClass(const Mapping &map) const {
-    int ret = S.classMatrix[map[a]][flip ? Ring::negate(map[b]) : map[b]];
     return S.classMatrix[map[a]][flip ? Ring::negate(map[b]) : map[b]];
   }
 };