Adding test server and fixing read during close.