Added some fixes to ResultCache and also some tests to test its functionality