Better tests and handle empty list