Bug fixes for ends of files and in noise plot