fix constraint caching.