fixed bug not checking for optional contracts when making overload contracts