Bug Fix: Fix bugs for ApbCache and ApbRandCache.