Fix an accidental dropping of static_cast