Follow-up to r221913. Fix some -Wcast-qual warning reasons.