Truncate strings to prevent database errors