Massless phases and symmetry restoration in abelian gauge theories and spin systems