Fixed bug with not enforcing const correctness on pointers in subtype_cast