Fixed config.then checks. Fixed subkey assignment.
Extracted code out of retrieve and into retrieveOne, setting it up to be reused.
Implemented retrieveOne in retrieve.