Fixes #7018 by extending `all_keys` to work with either short or long keys. Also removes the ununsed method `key_present`.