Minor bug corrections on database cache. Now it is tested and working.