Fixed issues #43 and #40
 for

Fixed issues #43 and #40
Some preparations for "support for saving plugins" feature (idea from
issue #37)