HCOLL-191 - added tests and fix for reading keys and values