Cleanup the keys list correctly