Bug fix in loading plugins