Change non-const references to pointers.