@qiangxue xor changed to simpler !== to be consistent with js code.