Update json decoder to emit errors properly