Improve how Contract.for handles errors.