[minor] Include keys in allocated mem
[test] Adding more tests