some cleanups for the plugin_mem plugin