Some contract fixes