Bug fixes and visual improvements

Changed the logfile output and fixed some bugs.