Fixed all of the warnings present on gcc 4.7.2

Compiled with -Wall and -Wextra.