fix on membership test (backport)