Rewritten cache code and fixed a bug that was in it.

3 files changed