Application of gradient corrections to density functional theory of atoms and solids