Fixed some accidental const casts