Self-interaction corrections in the density functional formalism