Better error message; remove duplicate handling of empty list