Fixes bug where non-JSON breaks everything.