Handle strings properly in @data and @pdata