Updated code contract definitions to remove bug when using library