[2.3] - Fixed issues when clear_cache_refresh_trees setting is activated

Please see #789