BufferedStream fixes