Fix bug in levelsOflist