fix the valrgind failure on master. This will conflicts with Paul's chan...

...geset.
I don't think you need to use const_cast to add "const" to a type.  The compiler should do this for you anyways since the return type of the function is const.  This cast seems redundant but harmless.