Fixes and improvements to Contrat class