Bugfixes in agreement.py.