Second time lucky for json related fixes.

Following discussion on #1665. =)