Fix Plugin class and make some tests.