Fixed some contract issues