Fix exception handling during plugin loading