Improve porting to last rust compiler version