Fixed some bug with filenames with spaces in them.