Fix GetKeyList and add test

Same problem.

Note the extra " " in the tests - I think this is a bug.

The comment in the test file seems to be causing a key with " " to be put in.