Fixed some errors. Need to fix CheckCache function
Fixed errors
test