Fix GetKeyList and add test