Introduce specific casts to fix multiple type cast conversion compilation errors. Reviewed-by: gtriantafill, hseigel