Fix command unregister in plugin manager