Add const qualifier to some member functions

Suggested by cppcheck