Fix casts with const pointers

Fix the removal of the const qualifier. Simply keep the const by using pointers to const values.