fixed more calls to error (that should be raise-argument-error) in the contract library