Fix bug with lists, add test