Fixed several compilation warnings. (gcc 4.1.2, -O3 -g -Wall)