Fix state handling in Plugin.pm

Hi,
especially the 'return' statment on line 310 ist just completely broken.

Regards, Mark