Make sure list_keys always returns array
remove some unnecessary checks