fix warnings to allow compiling with -O3