fix a bug in key.c to pass the unlimited test.