Fixed plugin crashes