Fixed bug when opening filenames with spaces.