Updated C casts to C++.