solved severals problem pointed by gcc warnings