US agencies shrink layoff plans after mass staff exodus