added PATTERN_WORD handling
improved one error message
 doc update