Fix emitting errors