Fix up some cache bugs.