Fix bug in fill_missing_tbl
Add tests, update documentation