Changed a lot of pointer calls to references, so merging this into develop.