Fixes to plugin API