Updated documentation and error handling for the match operation