[2.0.0] Fix aggregate functions cache

Fix #2401 for 2.0.0