fix stream parser

the newline before endstream is not required