Fixed Contract library, and converted asserts to use the Contract class.