fix a few compiler warnings on -O3