Fix NPE
Some formatting and improved input filenames