Fixed compiler warnings, mostly const.