Several fixes/tweaks to Plugin