Made some fixes to the plugin