Adapt code to remove compilation warnings