Support varying amounts of MACs

This fixes a problem where nodes with only 1 MAC would result in entries
with "undefined" as the MAC.