Added code contracts.