Where a contract has but a single object, and such object is unlawful, whether in whole or in part, or wholly impossible of performance, or so vaguely expressed as to be wholly unascertainable, the entire contract is void.
Where a contract has several distinct objects, of which one at least is lawful, and one at least is unlawful, in whole or in part, the contract is void as to the latter and valid as to the rest.