Fixing some -Wcast-qual warnings; NFC.