Fix const correctness issues