Fixed to properly close a reader.