Fixed problem with actions (needed to clear old actions before setting
the new ones)