Fixing invalid strings