Removing unnecessary punctuation from strings