Fixed bug with traversing list.

Code cleanup required.