Make these methods const correct.

Thanks to Nick Lewycky for noticing it.