Fixed reloading the plugin throwing errors. Wasn't closing a stream