Various bug fixes

Fixed unwanted extra window from Tkinter. Fixed bug where temporary
files would be created in current working directory rather than
directory of application.