fix a bunch of warnings (gcc)