Fixed bugg with caching value types