Cleanup, fix plugin bridge crashes