Updated queue handling in stream.lisp and other minor refactoring