Fix bugs in cache controller finite state machines.