Cleaned up a couple of bugs with list traversal