Switch to pointers instead of references everywhere.
Merge branch 'master' into locating_max