Update key matching function.
Merge branch 'next' into refactor