Fixed some compliation warnings, fixed compilation with gcc.