Fix bugs picked up by unit testing.
Make trans_tbl_t a named struct and move aside variable names the same as it.