Improve verification for custom matcher

This change also avoids run time error(index out of range).
Improve error message
Merge pull request #189 from peco/improve-verification-for-custom-matcher

Improve verification for custom matcher