Update UI and fix some bugs for agreements.