TypeError: Object #<Object> has no method 'emit'

The plugin was trying to emit an error from the wrong `this`, causing it to crash instead of displaying the error. This should fix that.
Merge pull request #9 from CWSpear/patch-1

TypeError: Object #<Object> has no method 'emit'