Fixed some minors issues where the const qualifier was being discarded.