Refine key test.