Fixes #2215 Double defined $cache on upgrade