Fixed bug in list generation