Fix a bug where close was called on a string.