Cache now works consistently in both debug and release mode.