Add comment, use sigmap
diff --git a/backends/aiger/xaiger.cc b/backends/aiger/xaiger.cc
index 8b809b2..e05b6cc 100644
--- a/backends/aiger/xaiger.cc
+++ b/backends/aiger/xaiger.cc
@@ -198,11 +198,11 @@
 			}
 		}
 
+		// Cannot fold into above due to use of sigmap
 		for (auto bit : input_bits)
 			undriven_bits.erase(sigmap(bit));
 		for (auto bit : output_bits)
-			if (!bit.wire->port_input)
-				unused_bits.erase(bit);
+			unused_bits.erase(sigmap(bit));
 
 		// TODO: Speed up toposort -- ultimately we care about
 		//       box ordering, but not individual AIG cells