Adding unit tests for string retrieval, plus fixes