fix incorrect use of RSTRING_PTR