Fix caching provider so it doesn't throw exceptions on empty sets