I was testing on the original version of the plugin (the not-so-smart one). I've replicated the issue and am working towards a solution using some of the code fragments you provided ...