Improved support for plugins; Added new tests.