properly close stream in test
whitespace