Fix empty list issue, correct wrapping in table cells, add testcases

Includes testcases