cleanups - mostly to critical section stuff for stream classes