Minor fixes to JSON API.