Now using const_pointer_cast instead of static_cast to modify shared pointers. (Although it worked with static_casts, but you never know) Former-commit-id: d42487bb0c
d42487bb0c