Have been doing some work on this in an attempt to fix a bug I came across the other day. From a first glance I see two possible options when looking at the plugin code: