Fixing some issues with undefined variables (that didn't prevent the plugin from functionning !)