Made some of the code const-correct