Added plugin errors. Implemented plugin tests. Closes #179.