Modified contract to throw exception if illegal arguments are passed when creating a contract.