Corner case failures: added trim(), corrected grammar in word count when one word found.