Bug fix - dealing with empty list in output