Fixed spaces in filenames, improved error logging