Fix undefined variable on restore and active plugin (issue #4)