Thanks so much for your reply! Just wanted to let you know that I wasn’t able to make it work doing exactly as you suggested. However, moving the $before_widget. did the trick.
Now it looks like this in my plugin file:
if( isset( $title ) )
echo $before_widget. $before_title. $title . $after_title . “\n” ;
And this seems to work as far as I can see…
Thanks so much for your help!