Remove const cast from leaf functions.