Use static_cast rather than the old C style cast.