Fixed up plugins and added tests