Improved test coverage and closing of streams / proxies.