Fix incorrect hiding task in case of anonymous scopes.