Deal leaves science agencies with less but avoids deep cuts.