Fixed error opening file with space in filepath or filename