fixed bug for writing primitive array types as map values. added test
cases