Fix broken whitelist/blacklist check