Iron out some bugs caused by refactoring the entire plugin