Fixed stream closing.