After you file

If the amount on line 21 is the sum of the amounts you put on lines 22 and 23 your amendment is valid and the IRS did the right thing.

It's unlikely the IRS would accept your 1040-X if that was not the case and pay you twice.