Make kind a string.
Fix bug when top level is array.