Use correct comparison functions in lattice
Fix ETG computation when there is more than one successor state
Improve extraction of last states