diff --git a/jni/filters/edge.c b/jni/filters/edge.c
index 5e7be3c..75e99a1 100644
--- a/jni/filters/edge.c
+++ b/jni/filters/edge.c
@@ -46,7 +46,7 @@
     // set initial buffer to black
     memset(buf, 0, buf_len * sizeof(char));
     for (j = 3; j < buf_len; j+=4) {
-        *(buf + j) = 255;  // set initial alphas
+        *(buf + j) = (uint8_t) 255;  // set initial alphas
     }
 
     // apply sobel filter
@@ -120,7 +120,7 @@
     int last_row = row_stride * (height - 1);
     memset((dst + last_row), 0, row_stride * sizeof(char));
     for (j = 3; j < row_stride; j+=4) {
-        *(dst + last_row + j) = 255;  // set alphas
+        *(dst + last_row + j) = (uint8_t) 255;  // set alphas
     }
     AndroidBitmap_unlockPixels(env, bitmap);
 }
diff --git a/jni/filters/geometry.c b/jni/filters/geometry.c
index c2d80f3..0230922 100644
--- a/jni/filters/geometry.c
+++ b/jni/filters/geometry.c
@@ -170,11 +170,13 @@
     AndroidBitmap_lockPixels(env, src, (void**) &source);
     AndroidBitmap_lockPixels(env, dst, (void**) &destination);
     // TODO: implement straighten
-    int i = 0;
-    for (; i < len; i += 4) {
-        destination[RED] = 128;
-        destination[GREEN] = source[GREEN];
-        destination[BLUE] = 128;
+    if (source != NULL && destination != NULL) {
+        int i = 0;
+        for (; i < len; i += 4) {
+            destination[RED] = (uint8_t) 128;
+            destination[GREEN] = (uint8_t) source[GREEN];
+            destination[BLUE] = (uint8_t) 128;
+        }
     }
     AndroidBitmap_unlockPixels(env, dst);
     AndroidBitmap_unlockPixels(env, src);
diff --git a/jni/filters/wbalance.c b/jni/filters/wbalance.c
index 99a7d2e..2ca4c72 100644
--- a/jni/filters/wbalance.c
+++ b/jni/filters/wbalance.c
@@ -18,7 +18,7 @@
 
 #include "filters.h"
 
-void estmateWhite(unsigned char *src, int len, int *wr, int *wb, int *wg){
+void estmateWhite(unsigned char *src, int len, int *wr, int *wb, int *wg) {
 
     int STEP = 4;
     int RANGE = 256;
@@ -27,7 +27,7 @@
     int *histB = (int *) malloc(256*sizeof(int));
     int i;
     for (i = 0; i < 255; i++) {
-        histR[i] = histG[i] = histB[i] =0;
+        histR[i] = histG[i] = histB[i] = 0;
     }
 
     for (i = 0; i < len; i+=STEP) {
@@ -35,9 +35,8 @@
         histG[(src[GREEN])]++;
         histB[(src[BLUE])]++;
     }
-    int min_r = -1, min_g = -1,min_b = -1;
-    int max_r = 0, max_g = 0,max_b = 0;
-    int sum_r = 0,sum_g=0,sum_b=0;
+    int min_r = -1, min_g = -1, min_b = -1;
+    int sum_r = 0, sum_g = 0, sum_b = 0;
 
     for (i = 1; i < RANGE-1; i++) {
         int r = histR[i];
@@ -47,25 +46,22 @@
         sum_g += g;
         sum_b += b;
 
-        if (r>0){
-            if (min_r < 0) min_r = i;
-            max_r = i;
+        if (r > 0 && min_r < 0) {
+            min_r = i;
         }
-        if (g>0){
-            if (min_g < 0) min_g = i;
-            max_g = i;
+        if (g > 0 && min_g < 0) {
+            min_g = i;
         }
-        if (b>0){
-            if (min_b < 0) min_b = i;
-            max_b = i;
+        if (b > 0 && min_b < 0) {
+            min_b = i;
         }
     }
 
-    int sum15r = 0,sum15g=0,sum15b=0;
-    int count15r = 0,count15g=0,count15b=0;
-    int tmp_r = 0,tmp_g=0,tmp_b=0;
+    int sum15r = 0, sum15g = 0, sum15b = 0;
+    int count15r = 0, count15g=0, count15b = 0;
+    int tmp_r = 0, tmp_g = 0, tmp_b = 0;
 
-    for (i = RANGE-2; i >0; i--) {
+    for (i = RANGE-2; i > 0; i--) {
         int r = histR[i];
         int g = histG[i];
         int b = histB[i];
@@ -91,33 +87,33 @@
     free(histG);
     free(histB);
 
-    if ((count15r>0) && (count15g>0) && (count15b>0) ){
+    if ((count15r > 0) && (count15g > 0) && (count15b > 0)) {
         *wr = sum15r/count15r;
         *wb = sum15g/count15g;
         *wg = sum15b/count15b;
-    }else {
+    } else {
         *wg  = *wb = *wr=255;
     }
 }
 
-void estmateWhiteBox(unsigned char *src, int iw, int ih, int x,int y, int *wr, int *wb, int *wg){
+void estmateWhiteBox(unsigned char *src, int iw, int ih, int x,int y, int *wr, int *wb, int *wg) {
     int r = 0;
     int g = 0;
     int b = 0;
     int sum = 0;
-    int xp,yp;
+    int xp, yp;
     int bounds = 5;
-    if (x<0) x = bounds;
-    if (y<0) y = bounds;
-    if (x>=(iw-bounds)) x = (iw-bounds-1);
-    if (y>=(ih-bounds)) y = (ih-bounds-1);
+    if (x < 0) x = bounds;
+    if (y < 0) y = bounds;
+    if (x >= (iw-bounds)) x = (iw-bounds-1);
+    if (y >= (ih-bounds)) y = (ih-bounds-1);
     int startx = x - bounds;
     int starty = y - bounds;
     int endx = x + bounds;
     int endy = y + bounds;
 
-    for(yp= starty;yp<endy;yp++) {
-        for(xp= startx;xp<endx;xp++) {
+    for (yp = starty; yp < endy; yp++) {
+        for (xp = startx; xp < endx; xp++) {
             int i = 4*(xp+yp*iw);
             r += src[RED];
             g += src[GREEN];
@@ -141,7 +137,7 @@
     int wg;
     int wb;
 
-    if (locX==-1)
+    if (locX == -1)
         estmateWhite(rgb,len,&wr,&wg,&wb);
     else
         estmateWhiteBox(rgb, width, height,locX,locY,&wr,&wg,&wb);
@@ -153,7 +149,7 @@
     float scaleG =  avg/wg;
     float scaleB =  avg/wb;
 
-    for (i = 0; i < len; i+=4)
+    for (i = 0; i < len; i += 4)
     {
         int r = rgb[RED];
         int g = rgb[GREEN];
