Made the contracts work reliably, and identified and fixed the last errors detected by the contracts.