Fix const correctness for function calls