Fix bug on empty list