Rejigger tests to cope with json output