Fix compiler warnings

We should be able to compile with -Wall on gcc without issues. This is needed for issue #14.

*I haven't tested this extensively, but the code should be functionally equivalent*.