Fix casting error and formatting issues.

I've fixed the error where you were casting the *Listener* to a *Plugin*.

I also fixed a few formatting issues.

I did this all in GitHub so a few errors may exist, but it should be trivial to fix them.