Worked on the caching system and fixed a few errors