fixed missing check in Stream reader and some more