Make JSON errors more friendly and less crashy