Bugfix in lattice class

Fix minor bug in traverse method. Some other minor changes.