Update plugin.py

Finished fixing bugs and typos.