Fix pointer comparison, string pointer detection, and string pointer copying