Trim strings before adding to db.