Fixed code for use of lists.