Fixed check for punctuation at the end of the content