Fixed _length_ to handle list of length 0