fix various compiler warnings on gcc