Fix potential memory leaks

Since /reloadmaps disables the plugin