Added new cache mechanism and new type tests.