Merge "const correctness to match upstream API"