Fixed some blocking bugs in ContractService.