Fix issue where string was not defined in prototype methods