Merge "Fix a bug where kernels could modify the input allocation."