Warning and compile error fixes for gcc 4.7.2 with -Wall -Wextra.