Fix bug appending to an empty list.