adding test for hash with nil values, fixing bug in which hash map was not encoding nil values