Hi Andres,
Thanks for the review!
> I don't think it is correct for any of these to add const. The only reason it> works is because of casting etc.
Fair enough. PFA the corrected patch v2.
-- Best regards,Aleksander Alekseev