Fixed converting array to JSON

@vparfonov @evidolob 
plz take a look and merge it