Fix bug where cache was incorrectly being sized