Fix some compiler warnings.

... add `const` declarations where appropriate.