Fixed a number of issues, plugin should function