Fixed problems with contracts