Fixed warning about unblessed reference in stream shutdown
Fixed bugs in stream monitor