Changed all uses of reinterpret_cast to static_cast