Replaced some C-style type conversions with reinterpret_cast.