Unrestricted Hartree—Fock Calculations. I. An Improved Method of Computing Spin Properties