Proper test for key existence