Fix compilation error under GCC, caused by attempting to const a reference.