Fixed compilation errors and most of the warnings for 2.10