Some gcc compilation issues fixed