Remove unneeded const_cast.