Plugwise fixes for issues #649, #496 and #497