Made sure the plugin wokrs.

Modifications/corrections/workarounds implemented while doing the experiment to make things work.
Maybe some of these should be dealt with in more subtle ways later.