Fixed plugin bugs.