Fix word validation logic

Word validation should return false if there are any non-word characters in the data.