Fixes some plugin crashes