[trunk] Review warning about types conversion, and add cast when needed