Fix a bug in plugin manager