fix empty list being wrapped and cleanup