fix handling of non-JSON data
cbugg: close bug-688