Fixed bug with empty list