Fixed error in list.c

There were some unincluded header files, plus a typo in a variable
declaration.