Changed a lot of non-const pointers to const.