error in program calculating taxable social security.

I just checked Wheres my Refund and found that the IRS found an error in my return.  The taxable social security amount was wrong, line 20b.  I checked it manually and found a problem on the social security worksheet which added the amount on the 1040 line 15a instead of the amount on line 15b(I am a US citizen residing in Spain and per the tax treaty between US and Spain, my IRA withdrawal is only taxable in Spain).  This caused my US taxes to decrease ove $1,500.00 which is not the problem.  The problem is I have to refile my Spanish taxes, decreasing the amount I declared under double imposition and this will cost me at least 110.00€ just ro refile and possible interest and fine to be determined later.  What happened to cause this error?