Usability improvements

Filename fixing, closing files when done.