Replace emit(end) with push(null)