Fix injected value, remove trailing whitespace.

A couple simple fixes to get things working again :)

I also added some code to clean up on event destruction, which I didn't actually intend to add to this pull request :) worth having I think regardless.