Clean-up of code and fixed window title.