Fixed NullPointerException on close in BufferReaderWriter