Fix issue affecting replace(); actually still a bug in ptr<char>()