[DF-1050] Replaced dynamic_cast by static_cast