Repaired plugin loading code.