Revert error return value changes.

Changes in #1204, #1288 mistakenly changed the values for some error defines, which breaks backward compatibility.