Preserve const correctness.

GCC complains about casting away const.