Fixed read close not working correctly.