Does this trace statement make sense?  "flow_map is 0" means it's not empty?  Better to write "flow_map.empty? %d"?