Imposing Moment Restrictions by Weighting