nth bit and comparator fix