Fixed plugin error handling