fixed various issues with the plugin