Fix const casting issue