JSON fix

Related to #129, #130, #131.