enabled gcc -Wall, and fixed compiler warnings.