Fix editing of contracts and formatting of dates