Avoid use of const_cast
Merge pull request #111 from wmtan/RemoveDangerousConstCast

Avoid use of const_cast