Fixed a bug regarding DP caching.