Plugin tweaks - bug fixes and running tests


This fixes a couple of bugs I discovered while developing a plugin recently.

It also amends build.xml to run backend and selenium tests from plugins if they have them.