Changed default behavior to remove empty lists and updated unittests slightly.