fixed some warnings (compiled with gcc -Wall)