Various fixes to diag_dump_states.php (Add interface column, some extra validation safety, etc). Should fix #2121
Just use ID here instead.