Added additional check in the refresh_slugs function in order to avoid strange warnings.