Remove unused imports.
Close stream in test.