small fixes in json generate