Work on GUI. Fixed a bug in path search. Some minor refactorings.