Fix IllegalStateException on plugin reload